package edu.ivanov.apm.chaos;

import edu.ivanov.apm.ui.FractalBoard;
import edu.ivanov.apm.ui.UI;

import java.util.HashMap;
import java.util.Map;

/**
 * User: Илья
 * Date: 08.10.13
 * Time: 20:19
 */
public class LSystems {

    private static double step = 15;
	private static double rotateAngle = Math.PI / 8;
	private static int iterations = 6;

	public static void main(String[] args) {
		FractalBoard board = new FractalBoard(makeRuleProducer(), iterations);
		board.setStep(step);
		board.setRotateAngle(rotateAngle);

		UI.show(board);
	}

    private static RuleProducer makeRuleProducer() {
        RuleProducer producer = new RuleProducer();
        producer.setAxiom("F");

        Map<Character, String> productions = new HashMap<Character, String>();
        productions.put('F', "-F+F+[+F-F-]-[-F+F+F]");
        producer.setProductions(productions);

        return producer;
    }
}
